package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.databinding.ActivityTemplatePreviewBinding;
import stark.common.basic.event.EventStatProxy;

public class TemplatePreviewActivity extends BaseAc<ActivityTemplatePreviewBinding> {

    public static Integer img;
    public static int position;

    @Override
    protected int onCreate() {
        return R.layout.activity_template_preview;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(this, mDataBinding.event1Container);

        mDataBinding.ivTemplatePreviewBack.setOnClickListener(v -> onBackPressed());

        mDataBinding.tvTemplatePreviewUse.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.tvTemplatePreviewUse://使用模板
                MakeCardActivity.position = position;
                startActivity(MakeCardActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {
        mDataBinding.ivTemplatePreviewImg.setImageResource(img);
    }
}